﻿/********************************************************************************************************************
* Author:	Aristidis Mihail																						*
* Email:	std03055@di.uoa.gr																						*
* Purpose:	This script is used in order to create the stored procedure "usp_user_get_categories_ModeratorOf" that	*
*			returns the categories a user moderates																	*
********************************************************************************************************************/

CREATE PROCEDURE [dbo].[usp_get_categories_moderatorOf]
	
	@Userid bigint	
AS

	SELECT [Category-Moderator].Category, [Categories].Name
	FROM [Category-Moderator] , Categories
	WHERE [Category-Moderator].Moderator=@Userid AND Categories.IsDeleted = 0 AND [Category-Moderator].Category=ID and [Category-Moderator].Category = Categories.ID	

RETURN 0